﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using RTGS.Library.Entities.UserManagement;
using RTGS.Library.DataAccess.UserManagement;
using System.Configuration;

namespace RTGS.Web.form.usermanagement
{

public partial class form_usermanagement_sys_t_logform : BasePage
    {
        private int id = -1;

        private sysTLogRepo logDal = new sysTLogRepo(ConfigurationManager.ConnectionStrings["Rtgs"].ConnectionString);

        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.Params["Id"] != null)
            {
                id = Convert.ToInt32(Request.Params["Id"]);
            }

            if (!Page.IsPostBack)
            {
                if (id > 0) // Edit an existing item
                {
                    sysTLog obj = logDal.GetById(id);
                    if (obj != null)
                    {
                        hfID.Value = id.ToString();
                        txtUserName.Text = obj.createdBy;
                        txtLogSource.Text = obj.logSource;
                        txtLogEvent.Text = obj.logEvent;
                        txtLogMessage.Text = obj.logMessage;
                        txtDate.Text = obj.createdDate.Value.ToString("dd/MM/yyyy HH:mm:ss");
                    }
                }
            }

        }

    }
}